package com.restaurant.springboot.service.impl;

import com.restaurant.springboot.entity.ShopEntity;
import com.restaurant.springboot.repositories.ShopRepository;
import com.restaurant.springboot.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.beans.Transient;
import java.util.Optional;

@Service
public class ShopServiceImpl implements ShopService {


    @Autowired
    private ShopRepository shopRepository;

    @Override
    public Optional<ShopEntity> getShopMessage(){
        return shopRepository.findById(1);
    }

    @Override
    @Transient
    public boolean updateShopMessage(ShopEntity shop){
        if(shopRepository.save(shop)!=null){
            return true;
        }
        return false;
    }

}
